
message("src/pnp")

# modify this according to your PC
set( EIGEN_INCLUDE_DIR "D:/eigen" )
find_package (glog 0.3.4 REQUIRED)

set(OpenCV_DIR "D:/opencv/vsbuild/install")
find_package(OpenCV REQUIRED)

message(STATUS ${OPENCV_INCLUDE_DIR})
if(OpenCV_FOUND)
	message(STATUS "find OpenCV")
	message(STATUS ${OPENCV_INCLUDE_DIR})
else()
	message(STATUS "not find OpenCV")
endif()

include_directories (
	${CMAKE_SOURCE_DIR}/pnp 
	${CMAKE_SOURCE_DIR}/pnp/p3pf
	${CMAKE_SOURCE_DIR}/pnp/p6p
	${OpenCV_INCLUDE_DIRS}
)

add_subdirectory (p3pf)
add_subdirectory (epnp)

# add pnp library
add_library(pnp pnp.cc camera_pose.cc p6p/p6p.cc)
target_link_libraries(pnp glog::glog p3pf epnp external_pose_algs)

# build example for epnp
add_executable(epnp_example epnp_example.cc)
target_link_libraries(epnp_example pnp)

# build example for p3pf
add_executable(p3pf_example p3pf_example.cc)
target_link_libraries(p3pf_example pnp)

# build example for p6p
add_executable(p6p_example p6p_example.cc)
target_link_libraries(p6p_example pnp)